<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>MVVM</title>
</head>
<body>
<div id="app">
  <input type="text" v-model="school.name">
<!--  {{school.name}}{{school.age}}-->
  <div>{{school.name}}</div>
  <div>{{school.age}}</div>
  <div>{{getNewName}}</div>
  <ul>
    <li>11111111</li>
    <li>2222222</li>
  </ul>
  <div v-html="message"></div>
  <button v-on:click="change">点击按钮</button>
</div>
</body>
<!--<script type="text/javascript" src="../../../node_modules/vue/dist/vue.js"></script>-->
<script type="text/javascript" src="./mvvm.js"></script>
<script type='text/javascript'>
  const vm = new Vue({
    el: '#app',
    data: {
      school: {
        name: '学校',
        age: 10
      },
      message: '<h1>我是html</h1>'
    },
    computed: {
      getNewName() {
        return this.school.name + '@@@@@@'
      }
    },
    methods: {
      change() {
        this.school.name = '点击了按钮'
      }
    }
  })
</script>
</html>
